package cn.itsource.itsource.domain;


import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;

//@Data
@Table(name="t_search_master_message")
public class SearchMasterMessage {
    @Id
    private Long id;
    private String name;
    private Double price;
    private String age;
    private Integer gender;
    private String coatColor;
    private String resources;
    private Integer petType;
    private String address;
    private Integer state;
    private String title;
    private Long userId;
    private Long shopId;
    private Date createTime;

    @Transient //设置当前这个属性为扩展字段
    private String resourcesUrl;

    public String getResourcesUrl() {
        if (StringUtils.isNotBlank(this.resources)) {
            return "http://47.95.117.210:8888" + this.resources;
        }
        return null;
    }


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    public String getCoatColor() {
        return coatColor;
    }

    public void setCoatColor(String coatColor) {
        this.coatColor = coatColor;
    }

    public String getResources() {
        return resources;
    }

    public void setResources(String resources) {
        this.resources = resources;
    }

    public Integer getPetType() {
        return petType;
    }

    public void setPetType(Integer petType) {
        this.petType = petType;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return "SearchMasterMessage{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", price=" + price +
                ", age='" + age + '\'' +
                ", gender=" + gender +
                ", coatColor='" + coatColor + '\'' +
                ", resources='" + resources + '\'' +
                ", petType=" + petType +
                ", address='" + address + '\'' +
                ", state=" + state +
                ", title='" + title + '\'' +
                ", userId=" + userId +
                ", shopId=" + shopId +
                ", createTime=" + createTime +
                '}';
    }
}
